package com.ssy.lingxi.pay.api.feign;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.pay.api.dto.request.aliPay.*;
import com.ssy.lingxi.pay.api.fallback.AliPayHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 *  支付宝支付内部接口
 * @author lqa
 * @version 2.0.0
 * @date 2021/11/3
 */
@FeignClient(value = "pay-service", fallback = AliPayHystrix.class)
public interface IAliPayFeign {
    /**
     * 订单支付
     * @param aliPayComputerRequest 接口参数
     * @return 支付页面
     */
    @RequestMapping(value = "/pay/aliPay/orderPay", method = RequestMethod.POST)
    Wrapper<String> orderPay(@RequestBody AliPayComputerRequest aliPayComputerRequest);
    /**
     * 查询订单
     * @param aliPayOrderQueryRequest
     * @return
     */
    @RequestMapping(value = "/pay/aliPay/orderQuery", method = RequestMethod.POST)
    Wrapper<Object> orderQuery(@RequestBody AliPayOrderQueryRequest aliPayOrderQueryRequest);
    /**
     * 关闭订单
     * @param aliPayCloseOrderRequest
     * @return
     */
    @RequestMapping(value = "/pay/aliPay/closeOrder", method = RequestMethod.POST)
    Wrapper<Object> closeOrder(@RequestBody AliPayCloseOrderRequest aliPayCloseOrderRequest);
    /**
     * 申请退款
     * @param aliPayRefundRequest
     * @return
     */
    @RequestMapping(value = "/pay/aliPay/refund", method = RequestMethod.POST)
    Wrapper<Object> refund(@RequestBody AliPayRefundRequest aliPayRefundRequest);
    /**
     * 查询退款
     * @param aliPayRefundQueryRequest
     * @return
     */
    @RequestMapping(value = "/pay/aliPay/refundQuery", method = RequestMethod.POST)
    Wrapper<Object> refundQuery(@RequestBody AliPayRefundQueryRequest aliPayRefundQueryRequest);
}
